<template>
  <div id="app">
    <Tobar></Tobar>
    <Header></Header>
    <router-view />
    <Footer></Footer>
    <!-- 登陆框 -->
    <Login v-show="loginshow"></Login>
    <!-- 提示框 -->
    <transition name="slide">
      <Toast v-if="toastshow"></Toast>
    </transition>
  </div>
</template>

<script>
import Header from "./components/Header.vue";
import Footer from "./components/Footer.vue";
import Tobar from "./components/Tobar.vue";
import Login from "./components/Login.vue";
import Toast from "./components/Toast.vue";

import { mapState } from "vuex";

export default {
  components: {
    Tobar,
    Header,
    Footer,
    Login,
    Toast,
  },
  computed: {
    ...mapState({
      loginshow: (state) => {
        return state.Login.loginshow;
      },
      toastshow: (state) => state.ToastStatus.toastshow,
    }),
  },
};
</script>

<style lang="less">
#app {
  // background-color: #0c0;
}

.slide-enter,
.slide-leave-to {
  opacity: 0;
}
.slide-enter-active,
.slide-leave-active {
  transition: opacity 0.3s linear;
}
.slide-enter-to,
.slide-leave {
  opacity: 1;
}
</style>
